import 'package:flutterproject/generated/json/base/json_convert_content.dart';
import 'package:flutterproject/page/main/data/product_bean.dart';

ProductBean $ProductBeanFromJson(Map<String, dynamic> json) {
	final ProductBean productBean = ProductBean();
	final List<ProductBanners>? banners = jsonConvert.convertListNotNull<ProductBanners>(json['banners']);
	if (banners != null) {
		productBean.banners = banners;
	}
	final List<ProductProducts>? products = jsonConvert.convertListNotNull<ProductProducts>(json['products']);
	if (products != null) {
		productBean.products = products;
	}
	return productBean;
}

Map<String, dynamic> $ProductBeanToJson(ProductBean entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['banners'] =  entity.banners?.map((v) => v.toJson()).toList();
	data['products'] =  entity.products?.map((v) => v.toJson()).toList();
	return data;
}

ProductBanners $ProductBannersFromJson(Map<String, dynamic> json) {
	final ProductBanners productBanners = ProductBanners();
	final int? createTime = jsonConvert.convert<int>(json['createTime']);
	if (createTime != null) {
		productBanners.createTime = createTime;
	}
	final String? flag = jsonConvert.convert<String>(json['flag']);
	if (flag != null) {
		productBanners.flag = flag;
	}
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		productBanners.id = id;
	}
	final String? imageUrl = jsonConvert.convert<String>(json['imageUrl']);
	if (imageUrl != null) {
		productBanners.imageUrl = imageUrl;
	}
	final String? lang = jsonConvert.convert<String>(json['lang']);
	if (lang != null) {
		productBanners.lang = lang;
	}
	final int? state = jsonConvert.convert<int>(json['state']);
	if (state != null) {
		productBanners.state = state;
	}
	final String? targetUrl = jsonConvert.convert<String>(json['targetUrl']);
	if (targetUrl != null) {
		productBanners.targetUrl = targetUrl;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		productBanners.title = title;
	}
	final int? updateTime = jsonConvert.convert<int>(json['updateTime']);
	if (updateTime != null) {
		productBanners.updateTime = updateTime;
	}
	return productBanners;
}

Map<String, dynamic> $ProductBannersToJson(ProductBanners entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['createTime'] = entity.createTime;
	data['flag'] = entity.flag;
	data['id'] = entity.id;
	data['imageUrl'] = entity.imageUrl;
	data['lang'] = entity.lang;
	data['state'] = entity.state;
	data['targetUrl'] = entity.targetUrl;
	data['title'] = entity.title;
	data['updateTime'] = entity.updateTime;
	return data;
}

ProductProducts $ProductProductsFromJson(Map<String, dynamic> json) {
	final ProductProducts productProducts = ProductProducts();
	final String? description = jsonConvert.convert<String>(json['description']);
	if (description != null) {
		productProducts.description = description;
	}
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		productProducts.id = id;
	}
	final String? mainImage = jsonConvert.convert<String>(json['mainImage']);
	if (mainImage != null) {
		productProducts.mainImage = mainImage;
	}
	final int? price = jsonConvert.convert<int>(json['price']);
	if (price != null) {
		productProducts.price = price;
	}
	final int? stock = jsonConvert.convert<int>(json['stock']);
	if (stock != null) {
		productProducts.stock = stock;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		productProducts.title = title;
	}
	return productProducts;
}

Map<String, dynamic> $ProductProductsToJson(ProductProducts entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['description'] = entity.description;
	data['id'] = entity.id;
	data['mainImage'] = entity.mainImage;
	data['price'] = entity.price;
	data['stock'] = entity.stock;
	data['title'] = entity.title;
	return data;
}